package com.chuji.crmcj.adapter;

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.chuji.crmcj.R;
import com.chuji.crmcj.utils.UIUtils;

import java.util.List;

/**
 * Created by w.pitt on 2016/2/24.
 */
public class downListAdapter extends BaseAdapter {

    public List<String> mLevels;
    private Activity mActivity;

    public downListAdapter(Activity mActivity, List<String> mLevels) {
        this.mLevels = mLevels;
        this.mActivity = mActivity;
    }

    @Override
    public int getCount() {
        return mLevels != null ? mLevels.size() : 0;
    }

    @Override
    public Object getItem(int position) {
        return mLevels.size();
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = View.inflate(UIUtils.getContext(), R.layout.layout_listview, null);
        TextView textView = (TextView) convertView.findViewById(R.id.tv);
        textView.setText(mLevels.get(position));
        return convertView;
    }
}
